import {getStudentsByIdRequest} from "@/api/hyw/studentsRequest.js";
import {getLeadersByIdRequest} from "@/api/hyw/leadersRequest.js";

const personalPortalModule = {
    namespaced : true,
    state:{
        viewFlag:'main',
        students:{},
        leaders:{},
        freshmen:{}
    },
    mutations:{
        SET_VIEWFLAG(state, data){state.viewFlag=data},
        SET_Students(state, data){state.students=data;},
        SET_Leaders(state, data){state.leaders=data;},
        SET_Freshmen(state, data){state.leaders=data;},
    },
    actions:{
        getStudentsByIdAction(context, data){getStudentsByIdRequest(context,data);},
        getLeadersByIdAction(context, data){getLeadersByIdRequest(context,data);},
        getFreshmenByIdAction(context, data){getLeadersByIdRequest(context,data);},
    },
    getters:{
        getFlag(state){return state.viewFlag},
        getStudentsById(state){return state.students},
        getLeadersById(state){return state.leaders},
        getFreshmenById(state){return state.leaders},
    },
}

export default personalPortalModule